import axios from 'axios'

export function request(config){
//创axios实例
const instance = axios.create({
  baseURL: 'https://marger.vercel.app/',
  timeout: 5000
})

//请求响应拦截
instance.interceptors.request.use(config=>{
  return config
},err => {
  console.log("请求拦截"+err);
})

//响应拦截
instance.interceptors.response.use(res => {
  return res
},err =>{
  console.log("响应拦截"+err);
})

return instance(config)
}